﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using T.FAS.Runtime.Metadata.Entity.DataModel;
using T.FAS.Runtime.DataAccess.SQLDom;
using T.FAS.Runtime.DataAccess.Common;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.DataAccess.Engine
{
    /// <summary>
    /// SQLBuilder工厂类
    /// </summary>
    class SQLBuilderFactory
    {
        //public static ISQLDomBuilder CreateSQLBuilder()
        //{
        //    return SQLBuilderImpl.GetInstance();
        //}

        public static ICDOSQLBuilder CreateCDOSQLBuilder()
        {
            return new CDODefaultSQLBuilder();
        }

        public static IDQSQLBuilder CreateDQSQLBuilder()
        {
            return new DQDefaultSQLBuilder();
        }

        //public static ISQLDomBuilder CreateSQLBuilder(CompositeDataObject CompositeDataObject)
        //{
        //    //var mainDbType = CompositeDataObject.RootCompositeNodeObject.DataObject.DataSource.DbType;
        //    var mainDbType = EnumTools.Convert<DatabaseType>(CompositeDataObject.RootCompositeNodeObject.DataObject.Database.DbType);

        //    switch (mainDbType)
        //    {
        //        case DatabaseType.ES:
        //            return new ESSQLBuilder();
        //        case DatabaseType.SQLServer:
        //        case DatabaseType.MySQL:
        //        case DatabaseType.Oracle:
        //            return CreateSQLBuilder();
        //        default:
        //            return CreateSQLBuilder();
        //    }
        //}

    }
}
